In [1]:
import sys
import numpy as np
import pandas as pd
import seaborn as sns
sns.set_theme()
In [2]:
results_folder = 'mmvec_major_taxa_2'
results_base_name = 'latent_dim_3_input_prior_1.00_output_prior_1.00_beta1_0.90_beta2_0.95'
In [3]:
table = pd.read_table(results_folder + '/' + results_base_name + '_ranks.txt', index_col=0)
table.head()
Out[3]:
Propionibacteriaceae Staphylococcus caprae or capitis Staphylococcus epidermidis Staphylococcus hominis Other Staphylococci Polyomavirus HPyV6 Polyomavirus HPyV7 Merkel Cell Polyomavirus Malasseziaceae Corynebacteriaceae Micrococcaceae Other families
featureid
X940001 0.111823 0.006616 0.050163 -0.001373 0.099477 0.048717 -0.015278 0.082663 -0.016479 0.391788 0.167430 0.036258
X940002 -0.037990 -0.158498 -0.256362 -0.062324 -0.022124 -0.070099 -0.090522 -0.089765 -0.051773 -0.057602 -0.087969 -0.121828
X940005 -0.035200 -0.181835 -0.301041 -0.328792 0.202456 0.600453 0.238876 0.140972 0.017801 0.009918 0.071340 -0.009364
X940007 0.445166 0.335722 0.224301 0.512379 0.381924 0.168751 0.260878 0.300112 0.413439 0.399129 0.329138 0.312755
X940010 0.302998 -0.218579 0.748987 0.499472 0.354388 0.560653 1.057405 0.859181 -0.107463 0.440688 0.758574 0.595320
In [4]:
table['Selected'] = np.isin(table.index,
                            ['X940203', 'X940589', 'X940625', 'X940925', 'X940936', 'X942191',
                             'X942237', 'X950023', 'X950028', 'X950056', 'X950157', 'X950173',
                             'X950193', 'X950225', 'X950228', 'X950233', 'X950254', 'X950396',
                             'X950485', 'X950584', 'X950661', 'X950999', 'X960035', 'X960242',
                             'X960306', 'X960421', 'X960463', 'X960465', 'X960712', 'X960726',
                             'X960934', 'X961553', 'X961686', 'X970018', 'X970091', 'X970092',
                             'X970232', 'X970283', 'X970327', 'X970342', 'X970633', 'X970680']
                           )
table.sort_values('Selected', inplace=True)
sns.relplot(
    table,
    y='Propionibacteriaceae', x='Staphylococcus epidermidis', hue='Selected'
)
Out[4]:
<seaborn.axisgrid.FacetGrid at 0x7f946274a490>
In [5]:
sns.pairplot(table, hue='Selected')
Out[5]:
<seaborn.axisgrid.PairGrid at 0x7f9462548790>
In [6]:
for i in table.columns[:-1]:
    sns.displot(table, x=i, hue='Selected', multiple='stack')